<%@ page import="java.util.ArrayList" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.docman.domainmodel.*;" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>DocMan Ayrıntılı Arama</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="js/jDatePicker/jquery-ui.css" media="screen" />
<style type="text/css">
	p {color: #5481E3; font-weight: bold}
</style>

<script type="text/javascript" src="js/jDatePicker/jquery-1.9.1.js"></script>
<script type="text/javascript" src="js/jDatePicker/jquery-ui.js"></script>
<script src="js/jquery.validate.js" type="text/javascript"></script>

<script type="text/javascript">

  $(function() {
    $( "#oldDate" ).datepicker();
    $( "#oldDate" ).datepicker( "option", "dateFormat", "yy-mm-dd" );
    
    $( "#newDate" ).datepicker();
    $( "#newDate" ).datepicker( "option", "dateFormat", "yy-mm-dd" );
    
  });
  </script>
<script type="text/javascript">

jQuery(function()
{
	jQuery("#docTag").validate(
            {
                expression: "if (VAL == -1) return false; else return true;",
                message: " <span style=\"color:red\">Bir tag seçiniz.</span>"
            });
});

</script>  
</head>
<body>

<div id="main_container">
	<div id="header">
			<div class="logo"><a href="index.jsp"><img src="img/top.png" border="0" alt="" title="" /></a></div>       
	</div>
        <div class="menu">
        	<ul>                                                                         
        		<li><a href="index.jsp">Anasayfa</a></li>
                <li><a href="profileServletpath">Profil</a></li>
                <li><a href="getTagServletpath?sId=0">Dosya Yükleme</a></li>
                <li class="selected"><a href="#">Ayrıntılı arama</a></li>
                <li><a href="contract.jsp">İletişim</a></li>
                <% if(session.getAttribute("currentSessionUser")!= null){ 
                 UserBean user = (UserBean)session.getAttribute("currentSessionUser");%>
                <li><a href="logout.jsp">Çıkış <span style="color: red;">(<span style="font-weight: bold;
                     text-decoration: underline"><%= user.getUserName() %></span>)</span></a></li>
                <% } else { %>
                <li><a href="getUniandDeptServletpath">Kaydol</a></li>
                <% } %>
        	</ul>
        </div>
        
    <div class="center_content">
    	
    	<%ArrayList<TagBean> tags = (ArrayList<TagBean>)(request.getAttribute("tagList")); %>
        <% if(session.getAttribute("currentSessionUser")!= null){            
        	String errorMsg = (String)request.getAttribute("error"); %>
    		
    		<% if(errorMsg != null){ %>
            <ul>
            	<li><h3 style="color: red"><%= errorMsg %></h3></li>
            </ul>
             <% } %>

			<fieldset>
			<form action="advanceSearchServletpath" method="post">
				<table>
					<tr>
					<td><p>Dosya Adı: </p></td>
					<td><input type="text" name="docName" title="Dosya adına göre ara" size="20" id="docName"/></td>
					</tr>
					<tr>
						<td><p>Dosya Etiketi: </p></td>
						<td><select name="docTag" id="docTag">
							<option value="-1" >Seçiniz</option>
							<% for(int i = 0; i < tags.size(); i++){ %>
			                	<option value="<%=tags.get(i).getTagName() %>"><%=tags.get(i).getTagName() %></option>
			                <%} %>	
						</select></td>
					</tr>
					<tr>
						<td><p>Yükleyen Kişi: </p></td>
						<td><input type="text" name="uploader" size="20" title="Dosya yükleyen kişilere göre arama" id="uploader"/><td>
					</tr>
					<tr>
						<td><p>Zaman Aralığı:</p></td>
						<td><input readonly name="oldDate" type="text" id="oldDate" >
						<span style="color: #5481E3">tarihinden</span> <input readonly name="newDate" type="text" id="newDate" ><span style="color: #5481E3"> tarihine kadar</span></td>
					</tr>
					<tr>
						<td colspan="2"><input type="submit" name="ara" class="button" value="Ara"/></td>
					</tr>
				</table>
				</form>
			</fieldset>

		<% }else { %>
		
			<p style="font-size: 1.5em; text-align: center;color:red">Lütfen <a href="index.jsp">Anasayfa</a>'dan giriş yapınız.  </p>	
			<p style="font-size: 1.5em; text-align: center;color:red">Veya menüden Kaydol butonuna tıklayıp sitemize üye olabilirsiniz. </p>
		
		<% } %> 
    </div>
         
</div>

</body>
</html>